﻿#include "UdpCodec_Register.h"

#include "DeviceRegisterCodec.h"


UdpCodec_Register::UdpCodec_Register()
{
  setObjectName(getClassNameFirstLow<UdpCodec_Register>());
}

UdpCodec_Register::~UdpCodec_Register()
{

}

DataPackage_UdpCodec* UdpCodec_Register::decode(DataPackage_UdpCodec* dataPackageInfo_Device)
{
  return deviceRegisterCodec->decode(dataPackageInfo_Device);
}

DeviceRegisterCodec* UdpCodec_Register::getDeviceRegisterCodec()const
{
  return deviceRegisterCodec;
}

UdpCodec_Register* UdpCodec_Register::setDeviceRegisterCodec(DeviceRegisterCodec* const deviceRegisterCodec)
{
  this->deviceRegisterCodec=deviceRegisterCodec;
  printInjection(this,deviceRegisterCodec);
  return this;
}

void UdpCodec_Register::objectAutoInjection(QHash<QString, QObject *> *objMap)
{
  setDeviceRegisterCodec(getObjFromMap<DeviceRegisterCodec>(objMap));
}
